SftTree/NET 2.0

Move Method, ItemClass Class

Softel vdm, Inc.

Moves an item to a new position in the tree control.

Syntax      ItemClass Class (Softelvdm.SftTreeNET)

VB   

Public Function Move( ByVal ItemCollection As ItemCollectionClass ) As ItemClass
Public Function Move( _
     ByVal ItemTarget As ItemClass, _
     ByVal Style As MoveStyleEnum _
  ) As ItemClass

C#   

public ItemClass Move( ItemCollectionClass ItemCollection );
public ItemClass Move(
     ItemClass ItemTarget,
     MoveStyleEnum Style );

C++   

public: ItemClass^ Move( ItemCollectionClass^ ItemCollection );
public: ItemClass^ Move(
     ItemClass^ ItemTarget,
     MoveStyleEnum Style );

ItemCollection

The item collection.

ItemTarget

Depending on the Style argument, ItemTarget specifies the target item, where the item is to be moved to, or null/Nothing if it is not required.

Style

Defines how the item is moved.

MoveStyleEnum

Value

Description

BeforeTargetAsSibling

0

The item is inserted before the target item as the target item's sibling. If the item and the target item are the same, the Move method has no effect. The Move method's ItemTarget parameter is required. The target item cannot be a child item of the item to be moved.

AfterTargetAsSibling

1

The item is inserted after the target item as the target item's sibling. If the item and the target item are the same, the Move method has no effect. The Move method's ItemTarget parameter is required. The target item cannot be a child item of the item to be moved.

TargetAsParentInsertFirst

2

The item is added as the target item's first child item. If the item and the target item are the same, the Move method has no effect. The Move method's ItemTarget parameter is required. The target item cannot be a child item of the item to be moved.

TargetAsParentAdd

3

The item is added as the target item's last child item. If the item and the target item are the same, the Move method has no effect. The Move method's ItemTarget parameter is required. The target item cannot be a child item of the item to be moved.

UpHierarchy

4

The item is moved up the hierarchy by one position and becomes the sibling item of the visible item that precedes it. If the item is already the first item in the tree control, the Move method has no effect. The Move method's ItemTarget parameter must be set to null/Nothing.

DownHierarchy

5

The item is moved down the hierarchy by one position. If the following, visible item is expanded, it becomes that item's first child item. If the following, visible item is collapsed, it becomes that item's next sibling item. If the item is already the last item in the tree control, the Move method has no effect. The Move method's ItemTarget parameter must be set to null/Nothing.

UpSibling

6

The item is moved up by one position and becomes the previous sibling item's previous sibling. If the item is already the first sibling, the Move method has no effect. The Move method's ItemTarget parameter must be set to null/Nothing.

DownSibling

7

The item is moved down by one position and becomes the next sibling item's next sibling. If the item is already the last sibling, the Move method has no effect. The Move method's ItemTarget parameter must be set to null/Nothing.

Return Value

The item object of the item after it has moved.

Comments

The Move method moves an item to a new position in the tree control.

Items that are moved lose their selection status and are no longer selected.

An item's child items and all its other properties are automatically moved.

When moving items within the same tree control, the item object returned by the Move method is the same. When moving between tree controls, a new item object represents the moved item in the new, target tree control. The original item object is no longer valid.

The Move method accepting an ItemCollection argument is usually used when moving items to an empty tree control. The tree control's empty item collection is represented by the ItemCollection property.


Feedback / comments / error reports for this topic
© 2007 - Softel vdm, Inc. - www.softelvdm.com